﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace MyTestProject.Themes.ImageButton
{
    public class ImageButtonNoSelect : Button
    {

        #region 依赖属性

        #region DisableImageUri

        /// <summary>
        /// 获取或设置按钮不可用时的图片Uri
        /// </summary>
        public ImageSource DisableImageUri
        {
            get { return (ImageSource)GetValue(DisableImageUriProperty); }
            set { SetValue(DisableImageUriProperty, value); }
        }

        public static readonly DependencyProperty DisableImageUriProperty =
            DependencyProperty.Register("DisableImageUri", typeof(ImageSource), typeof(ImageButtonNoSelect), new PropertyMetadata(null));

        #endregion

        #region DisplayText

        /// <summary>
        /// 获取或设置显示的文本
        /// </summary>
        public string DisplayText
        {
            get { return (string)GetValue(DisplayTextProperty); }
            set { SetValue(DisplayTextProperty, value); }
        }

        public static readonly DependencyProperty DisplayTextProperty =
            DependencyProperty.Register("DisplayText", typeof(string), typeof(ImageButtonNoSelect), new PropertyMetadata(null));

        #endregion

        #region DownImageUri

        /// <summary>
        /// 获取或设置按键按下时的图片Uri
        /// </summary>
        public ImageSource DownImageUri
        {
            get { return (ImageSource)GetValue(DownImageUriProperty); }
            set { SetValue(DownImageUriProperty, value); }
        }

        public static readonly DependencyProperty DownImageUriProperty =
            DependencyProperty.Register("DownImageUri", typeof(ImageSource), typeof(ImageButtonNoSelect), new PropertyMetadata(null));

        #endregion

        #region ImageHeight

        /// <summary>
        /// 获取或设置按钮图片高度
        /// </summary>
        public double ImageHeight
        {
            get { return (double)GetValue(ImageHeightProperty); }
            set { SetValue(ImageHeightProperty, value); }
        }

        public static readonly DependencyProperty ImageHeightProperty =
            DependencyProperty.Register("ImageHeight", typeof(double), typeof(ImageButtonNoSelect), new PropertyMetadata(16d));

        #endregion

        #region ImageWidth

        /// <summary>
        /// 获取或设置按钮图片宽度
        /// </summary>
        public double ImageWidth
        {
            get { return (double)GetValue(ImageWidthProperty); }
            set { SetValue(ImageWidthProperty, value); }
        }

        public static readonly DependencyProperty ImageWidthProperty =
            DependencyProperty.Register("ImageWidth", typeof(double), typeof(ImageButtonNoSelect), new PropertyMetadata(16d));

        #endregion

        #region NormalImageUri

        /// <summary>
        /// 获取或设置默认图片Uri
        /// </summary>
        public ImageSource NormalImageUri
        {
            get { return (ImageSource)GetValue(NormalImageUriProperty); }
            set { SetValue(NormalImageUriProperty, value); }
        }

        public static readonly DependencyProperty NormalImageUriProperty =
            DependencyProperty.Register("NormalImageUri", typeof(ImageSource), typeof(ImageButtonNoSelect), new PropertyMetadata(null));

        #endregion

        #region OverImageUri

        /// <summary>
        /// 获取或设置鼠标越过时的图片Uri
        /// </summary>
        public ImageSource OverImageUri
        {
            get { return (ImageSource)GetValue(OverImageUriProperty); }
            set { SetValue(OverImageUriProperty, value); }
        }

        public static readonly DependencyProperty OverImageUriProperty =
            DependencyProperty.Register("OverImageUri", typeof(ImageSource), typeof(ImageButtonNoSelect), new PropertyMetadata(null));


        #endregion

        #region IsSelectBt
        /// <summary>
        /// 按钮是否被选中
        /// </summary>
        public bool IsSelectBt
        {
            get { return (bool)GetValue(IsSelectBtProperty); }
            set { SetValue(IsSelectBtProperty, value); }
        }
        public static readonly DependencyProperty IsSelectBtProperty =
            DependencyProperty.Register("IsSelectBt", typeof(bool), typeof(ImageButtonNoSelect), new PropertyMetadata(false));
        #endregion

        #endregion

        #region 构造函数

        static ImageButtonNoSelect()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(ImageButtonNoSelect), new FrameworkPropertyMetadata(typeof(ImageButtonNoSelect)));
        }

        #endregion
    }
}
